@extends('views.layouts.app')
@include('user.sidebar')
@section('content')
    <div class="content">
        <div class="row custom-invoice">
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>昵称</th>
                    <th>头像</th>
                    <th>电话号</th>
                    <th>合伙人</th>
                    <th>店员</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $item)
                    <tr>
                        <td>{{ $item->nickname }}</td>
                        <td>
                            <img src="{{ $item->nickname }}" width="30">
                        </td>
                        <td>{{ $item->mobile }}</td>
                        <td>{{ $item->partner }}</td>
                        <td>{{ $item->personal }}</td>
                        <td>
                            <a class="btn btn-primary btn-xs delete-confirm" data-href="{{ route('admin.user.old.delete', ['mobile' => $item->mobile]) }}">删除</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
            {{ $data->links() }}
        </div>

        <div class="modal fade loading custom-hide" id="hideForm" tabindex="-1" role="dialog" aria-labelledby="hideFormLibel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog">
                <div class="content invoice" style="text-align: left">
                    <form class='form' id = 'scheduleForm' action="{{ route('admin.user.old.store') }}" method="POST">
                        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
                        <div class="form-group">
                            <label>电话：</label>
                            <input class="form-control" id="hideFormDate" name="mobile" type="text" style="width: 100%;"/>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-success form-control">提交</button>
                            <br />
                            <br />
                            <button type="button" class="btn" id="closeHideForm">关闭</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('scripts')
    <script>

        $('.showHideForm').on('click', function () {
            $("#hideForm").modal('show');
        });
        $('#closeHideForm').on('click', function () {
            $("#hideForm").modal('hide');
        });
    </script>
@endpush
